/**
 * Copyright (C), 2024, xxxx有限公司
 * FileName: FunctionConfig
 * Author:   TLVM
 * Date:     4/21/2024 9:25 PM
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.iqcctt.orangelightaiassistant.call;

import com.iqcctt.orangelightaiassistant.service.ChatBookService;
import org.springframework.ai.model.function.FunctionCallback;
import org.springframework.ai.model.function.FunctionCallbackWrapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FunctionConfig {
   @Bean
    public FunctionCallback weatherFunctionInfo(){
       FunctionCallbackWrapper.Builder<WeatherService.Request,
               WeatherService.Response> requestResponseBuilder =
               new FunctionCallbackWrapper.Builder<>(new WeatherService());
       requestResponseBuilder.withName("currentWeather");
       requestResponseBuilder.withDescription("获取城市温度信息");
       return requestResponseBuilder.build();
    }


    @Bean
    public FunctionCallback addAdderssBookConfig(ChatBookService chatBookService){
        FunctionCallbackWrapper.Builder<AdderssBookService.Request,
                AdderssBookService.Response> requestResponseBuilder =
                new FunctionCallbackWrapper.Builder<>(new AdderssBookService(chatBookService));
        requestResponseBuilder.withName("addAddressBook");
        requestResponseBuilder.withDescription("添加通讯录/联系人API接口信息");
        return requestResponseBuilder.build();
    }
}
